class RandomGenerator
    
    def initialize(seed)
        @seed = seed
    end
    
    def generateSequence
        srand @seed
        list = Array.new()
        while(list.length < 10):
                list.push(rand(255))
        end
        return list
    end
    
    def RandomGenerator.rotate_left(value)
        temp = value & 128
        return (2 * (value & 127)) + (temp >> 7)
    end
    
    def RandomGenerator.twist(value)
        return (256 * RandomGenerator.rotate_left(value >> 8)) + RandomGenerator.rotate_left(value & 255)
    end
    
    def RandomGenerator.tweak_seed(seed)
        temp = seed.value1 + seed.value2 + seed.value3
        seed.value1 = seed.value2
        seed.value2 = seed.value3
        seed.value3 = temp & 0xFFFF
    end
end
